﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace sXNAke.GameStates
{
    class Level_01
    {
        #region Atributos
        Song bg_Music;
        Pacman pacman;
        Background background;
        #endregion

        public Level_01(ContentManager Content, GameWindow Window)
        {
            Texture2D pacmanImg = Content.Load<Texture2D>("pacman");
            Texture2D backgroundImg = Content.Load<Texture2D>("level1");

            pacman = new Pacman(pacmanImg, Window);
            background = new Background(backgroundImg);

            //bg_Music = Content.Load<Song>("BG_01");

           // MediaPlayer.Play(bg_Music);
           /// MediaPlayer.Volume = 0.2f;

        }

        public void Update(GameTime gameTime)
        {
            pacman.update(gameTime);
            if (pacman.isPixelCollide(background))
            {
                pacman.isVisible();
            }
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            background.draw(spriteBatch);
            pacman.draw(spriteBatch);
        }
    }
}
